package org.neu.onlineparadise.utils;

@SuppressWarnings("all")//忽略错误,慎用
public class ThreadLocalUtil {
    //创建不可更改的实例化对象
    private static final ThreadLocal THREAD_LOCAL = new ThreadLocal<>();
    //获取键值对
    public static <T> T get(){return (T)THREAD_LOCAL.get();}

    //存入键值对
    public static void set(Object value){THREAD_LOCAL.set(value);}

    //清空ThreadLocal中的数据，防止内存溢出
    public static void remove(){THREAD_LOCAL.remove();}

}
